/*
 * 
 * Created on Jul 30, 2005
 */
package com.wgo.precise.client.ui.controller;

import org.eclipse.core.runtime.IStatus;

import com.wgo.precise.client.ui.controller.exceptions.RematoClientException;


/**
 * 
 * @author Petter L. H. Eide <petter@eide.biz>
 * @version $Id: Assert.java,v 1.1 2006-01-23 19:58:37 petterei Exp $
 */
public class Assert {

    public static void notNull(Object o) {
        if (o == null) {
            throw new RematoClientException("Object was null.");
        }
    }

    public static void notNull(Object o, String message) {
        if (o == null) {
            throw new RematoClientException("Object was null:" + message);
        }
    }

    public static void warningIfNull(Object o, String message){
    	if (null == o) {
    		RequirementPlugin.log(new ModelStatus(IStatus.WARNING, message));
    	}
    }
    public static void warningIfFalse(boolean statement, String message){
    	if (!statement) {
    		RequirementPlugin.log(new ModelStatus(IStatus.WARNING, message));
    	}
    }
    
}
